cmake_minimum_required(VERSION 3.5.0)

project(audio_v308_pro)

#######################################################
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
SET(CMAKE_C_COMPILER "aarch64-linux-gnu-gcc")
SET(CMAKE_CXX_COMPILER "aarch64-linux-gnu-g++")
# set(CMAKE_C_STANDARD 99)
# set(CMAKE_CXX_STANDARD 11)
set(CMAKE_BUILD_TYPE "RELEASE")

#######################################################
# 引用
include_directories(/usr/include/rga)
include_directories(/usr/include/opencv4)
include_directories(/usr/include/rockchip)
include_directories(model)
include_directories(model_3)

link_directories(model_3)

#######################################################

# 获取源文件
file(GLOB_RECURSE PRO_MODEL_INC model/*.h)
file(GLOB_RECURSE PRO_MODEL_SRC model/*.c)
file(GLOB_RECURSE V308_MODEL_INC model_3/*.h)
# message(STATUS "V308_MODEL_INC=${V308_MODEL_INC}")

# 生成可执行文件
add_executable(run_tset main.c ${PRO_MODEL_INC} ${PRO_MODEL_SRC} ${V308_MODEL_INC})

add_library(gdl703t SHARED ${PRO_MODEL_INC} ${PRO_MODEL_SRC})

# 简单的命名管道例程
# add_executable(simple_pipe example/simple_pipe_.c)

# 官方例程
# add_executable(sdkmp3 example/SdkMp3.c ${V308_MODEL_INC})
# add_executable(sdkmp3ex example/SdkMp3Ex.c ${V308_MODEL_INC})
# add_executable(sdkclient example/SdkClient.c ${V308_MODEL_INC})

# 链接第三方库
target_link_libraries(run_tset 
    avformat
    avcodec
    avutil
    opencv_core
    opencv_highgui
    opencv_imgproc
    opencv_imgcodecs
    rga
    rockchip_mpp
    CtsSdk
    pthread
    rt
)

target_link_libraries(gdl703t
    CtsSdk
    pthread
    rt
)

# target_link_libraries(sdkmp3 
#     CtsSdk
#     pthread
# )
# target_link_libraries(sdkmp3ex 
#     CtsSdk
#     pthread
# )
# target_link_libraries(sdkclient 
#     CtsSdk
#     pthread
# )